package com.sztx.pay.center.core.service;

import java.util.List;

import com.sztx.pay.center.common.util.Constance.CardType;
import com.sztx.pay.center.core.service.bean.ConfirmPoJo;
import com.sztx.pay.center.core.service.bean.SettleRequest;
import com.sztx.pay.center.core.service.bean.rpc.SettleRuleListRequest;
import com.sztx.pay.center.core.service.bean.rpc.SettleRuleListResponse;
import com.sztx.pay.center.core.service.bean.rpc.SettleRuleRequest;
import com.sztx.pay.center.core.service.bean.rpc.SettleRuleResponse;
import com.sztx.pay.center.core.service.util.SettleTradeType;
import com.sztx.pay.center.core.service.util.SettleType;
import com.sztx.pay.center.dataaccess.domain.SettleOrderDO;
import com.sztx.pay.center.dataaccess.entity.QuerySettle;
import com.sztx.se.core.service.BaseService;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface SettleService extends BaseService {
	
	/**
	 * 交易立即结算到账
	 * @param request
	 * @return 结算结果 1未支付,2 支付中,3 成功,4 失败,5 异常
	 */
	public ConfirmPoJo settleNow(SettleRequest request, String serviceName);
	
	public void settleLatter(SettleRequest request, String serviceName);
	
	public long calculateHandlingFee(SettleTradeType tradeType, SettleType settleType, String userId, long amount,String channelId,String bankId,CardType cardType);

	/**
	 * @param orderId
	 * @param orders
	 * @return 结算结果 1未支付,2 支付中,3 成功,4 失败,5 异常
	 */
	public ConfirmPoJo transfer(String orderId, List<SettleOrderDO> orders);

	/**
	 * 根据所给筛选条件查询CallBack列表
	 * @param query
	 * @param pageQuery
     * @return
     */
	List<SettleOrderDO> queryOrderSettle(QuerySettle query , PageQuery pageQuery);

	/**
	 * 根据所给筛选条件统计CallBack列表总数
	 * @param query
	 * @return
	 */
	int countOrderSettle(QuerySettle query);
		public int configSettleRule(SettleRuleRequest req);
	
	public SettleRuleResponse queryUserSettleRule(SettleRuleRequest req);
	
	public List<SettleRuleListResponse> querySettleRuleList(SettleRuleRequest req,PageQuery pageQuery);
	
	public Integer querySettleRuleCount(SettleRuleRequest req);
	
	public void configSettleRules(SettleRuleListRequest list,int type);
	
	public void cancleRule(String channelId,String userId);

	public void settlingOrders();
	}
